package com.test.java;

import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Collectors;

/**
 * 实现两个数字的互换
 */
public class test027 {

    /**
     * 利用异或交换位置，化成二进制进行换位
     * @param args
     */
    public static void main(String[] args) {
        Long a=127l;
        Long b=187l;
        a= a ^ b;
        b= b ^ a;
        a= a ^ b;
        System.out.println(a);
        System.out.println(b);
        String mm="001201000130000-00120100013000001";
        String[] miSplit = mm.split("-");
        System.out.println(miSplit[0]);
        System.out.println(miSplit[1]);
        String price=null;
        System.out.println(new BigDecimal(price==null?"0":price).compareTo(BigDecimal.ZERO));

        String ss="330104";
        System.out.println(ss.contains("3301"));

        List<String> list=new ArrayList<>();
        Map<String,List<String>> map=new HashMap<>();
        map.put("333",list);
        System.out.println(map.get("333")+"12312313");

        List<MiHosptransPayinfoEntity> aaa=new ArrayList<>();
        MiHosptransPayinfoEntity entity=new MiHosptransPayinfoEntity();
        entity.setDetailNum("1403348158959910918");
        MiHosptransPayinfoEntity entity2=new MiHosptransPayinfoEntity();
        entity2.setDetailNum("1403348158959910918");
        aaa.add(entity);
        aaa.add(entity2);
        long collect = aaa.stream().map(MiHosptransPayinfoEntity::getDetailNum).distinct().count();
        System.out.println(collect);
//        LinkedHashSet<String> linkedHashSet=new LinkedHashSet<>(collect);
//        System.out.println(linkedHashSet.size());

        List<String> resultCode=new ArrayList();
        resultCode.add("0");
        resultCode.add("");
        String code="0";
        for (String item : resultCode) {
            if (!item.equals("0")){
                code="-1";
                break;
            }
        }
        System.out.println(code);

    }
}
